package com.fusion.core.comm.rpc;

import com.fusion.core.comm.Packet;
import com.fusion.core.comm.RPC;
import com.fusion.core.comm.T;

/**
 * @author SwethaShivakumar 
 * Project: fusion
 * Date: Mar 7, 2009
 * URL: http://fusionwiki.co.cc
 * Mail Me At: shiva@fusionproject.co.cc
 */
public class Pong extends RPC {
    public void execute(Packet p) {
        String s = "Received Pong from "+con.getRemoteFriend().getNickname()+". RTT: "+(System.currentTimeMillis()-con.getLastPacketSentAt())+"ms";
        if(T.t)T.info(s);
        con.pongReceived();
        core.updateLastSeenOnlineFor(con.getRemoteFriend());
    }

    public Packet serializeTo(Packet p) {
        return p;
    }
}
